<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>学术资源管理平台</title>
	<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../../../css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="../../../datatables/media/css/jquery.dataTables.min.css">
	<link rel="stylesheet" type="text/css" href="../../../datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../../../css/dateRange.css">
	<link rel="stylesheet" type="text/css" href="../../../css/global.css">
</head>
<body>
	<!-- InportModal -->
	<div class="modal fade" id="myModalInport" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<span class="modal-title">上传文件</span>
				</div>
				<div class="modal-body">
					<form enctype="multipart/form-data" method="post" name="uploadForm">  
						<input type="file" class="btn btn-default" name="file" id="fff" />  
						<input type="button" class="btn btn-primary upLoadBtn" value="上传" onclick="doUpload()"  data-toggle="modal" data-target="#inportSuccess"  data-dismiss="modal"/>
					</form> 
					<a class="downloadTemplet" href="#">点此下载模板</a>
				</div>
			</div>
		</div>
	</div>

	<!-- InportSuccess -->
	<div class="modal fade tips" id="inportSuccess" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
				<div class="modal-body">
					<i class="fa fa-check-circle-o" aria-hidden="true">&nbsp;&nbsp;上传成功!</i>
					
				</div>
			</div>
		</div>
	</div>
	<!-- ExportModal -->
	<!-- <div class="modal fade " id="myModalExport" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<span class="modal-title">导出模板</span>
				</div>
				<div class="modal-body">
					<form enctype="multipart/form-data" method="post" name="uploadForm">  
						<input type="text" name="" id="" placeholder/>  
						<input type="button" class="btn btn-primary upLoadBtn" value="浏览" onclick="doUpload()"  data-toggle="modal" data-target="#inportSuccess"  data-dismiss="modal"/>
					</form> 
				</div>
			</div>
		</div>
	</div> -->

	<div class="">
		<!-- 导航栏 -->
		<div class="navbar navbar-fixed-top scroll-hide">
			<!-- 顶上导航栏 -->
			<div class="container-fluid top-bar topnav"></div>
			<!-- 横向导航栏 -->
			<div id="main-nav" class="container-fluid main-nav"></div>
		</div>

		<div class="container-fluid">
			<div class="row">
				<!-- 侧边导航栏 -->
				<div id="sub-nav" class="col-md-2 subnav"></div>
				<div class="col-md-offset-2 mainContent" >
					<div class="InportExport">
						<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModalInport">导入</button>
						<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModalExport">导出</button> -->
						<div class="btn-group">
							<button type="button" onclick="makeURL()" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								导出 <span class="caret"></span>
							</button>
							<ul class="dropdown-menu">
								<li data-toggle="modal" data-target="#myModalExport" onclick="doDownload()">
									<a href="http://123.206.190.167:8080/dissertation/excel/scientificProjectTemplate?categoryLeafName=科研项目&uniqueName=教师科研&fileName=教师信息.xlsx">导出模板</a></li><li role="separator" class="divider"></li>
								<li data-toggle="modal" data-target="#myModalExport" onclick="doDownloadAll()">
									<a href="http://123.206.190.167:8080/dissertation/excel/scientificProjectAll?categoryLeafName=科研项目&uniqueName=教师科研&fileName=教师信息.xlsx">导出全部数据</a></li><li role="separator" class="divider"></li>
								<li data-toggle="modal"  data-target="#myModalExport"><a id="import_selected" href="#">导出选中数据</a></li>
							</ul>
						</div>
					</div>
					<div class="accurateSelect">
						<div class="ta_date doubletime" id="div_date_double">
							<span class="date_title" id="date_double"></span>
							<a class="opt_sel" id="input_trigger_double" href="#">
								<i class="i_orderd"></i>
							</a>
						</div>
						<div class="ta_date singalTime" id="div_date_single">
							<span class="date_title" id="date_single"></span>
							<a class="opt_sel" id="input_trigger_single" href="#">
								<i class="i_orderd"></i>
							</a>
						</div>
					</div>
					<table class="mainTable table table-bordered" >
					<!-- <tr>
						<th></th>
						<th>序号</th>
						<th>科研项目名称</th>
						<th><select>科研项目类型</select></th>
						<th><select>第一责任人</select></th>
						<th>立项时间</th>
						<th>完整度</th>
					</tr> -->
					</table>
				</div>
			</div>
		</div>
	</div>
	<footer class="footer navbar-fixed-bottom"></footer>


	<script type="text/javascript" src="../../../js/jquery-1.12.3.min.js"></script>
	<script type="text/javascript" src="../../../js/bootstrap.js"></script>
	<script type="text/javascript" src="../../../datatables/media/js/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="../../../js/global.js"></script>
	<script type="text/javascript" src="../../../js/admin/ScienceProject.js"></script>
	<script type="text/javascript" src="../../../js/index.js"></script>
	<script type="text/javascript" src="../../../js/dateRange.js"></script>
	<script type="text/javascript">
		var dateRange = new pickerDateRange('date_single', {
			isSingleDay : true,
			calendars:1,
			isTodayValid: true,
			startDate: '请选择日期',
			defaultText: '',
			endDate: '',
			inputTrigger: 'input_trigger_single',
			theme: 'ta',
			success: function(obj) {
				startTime = new Date($('#' + this.startDateId).val().replace(/-/g, "/"));
				console.log(startTime)
				$.ajax({
					type: "get",
					url: "http://123.206.190.167:8080/dissertation/ScientificProject/date?begin="+startTime,
					data: {
					},
					async: true,
					dataType: "json",
					contentType: "application/json",
					success: function(data) {
						setTableData(data)
					},
					Error: function() {
						alert("服务器出错");
					}
				})
			}
		});
		var dateRange = new pickerDateRange('date_double', {
			isTodayValid: true,
			startDate: '请选择日期区间',
			endDate: '',
			// autoSubmit: true,
			defaultText: ' 至 ',
			inputTrigger: 'input_trigger_double',
			theme: 'ta',
			success: function(obj) {
				startTime = new Date($('#' + this.startDateId).val().replace(/-/g, "/"));
				endTime = new Date($('#' + this.endDateId).val().replace(/-/g, "/"));
				console.log(startTime)
				console.log(endTime)
				$.ajax({
					type: "get",
					url: "http://123.206.190.167:8080/dissertation/ScientificProject/date?begin="+startTime+"&end="+endTime,
					data: {
					},
					async: true,
					dataType: "json",
					contentType: "application/json",
					success: function(data) {
						setTableData(data)
					},
					Error: function() {
						alert("服务器出错");
					}
				})
			}
		});




		
			/*$.ajax({  
				url: 'http://123.206.190.167:8080/dissertation/excel/export' ,  
				type: 'POST',  
				// data: formData,
				data: {

				}  
				async: false,  
				cache: false,  
				contentType: false,  
				processData: false,  
				success: function (returndata) {  
					alert(returndata);  
				},  
				error: function (returndata) {  
					alert(returndata);  
				}  
			});  */


		</script>

	</body>
	</html>